<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control"  content="no-transform">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>订单支付</title>
    <link href="/statics/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/statics/view/css/all.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body{
            background: #f1f1f1;
        }
    </style>
</head>
<body>
<div class="alert alert-success" role="alert">
    <h3>订单确认与支付</h3>
    <p>请确认信息并完成支付</p>
</div>
<div class="container" style="padding-bottom: 50px;">
    <ul class="list-group">
        <li class="list-group-item">
            <span class="badge">${order.sn}</span>
            订单编号:
        </li>
        <li class="list-group-item">
            <span class="badge">${order.productName}</span>
            订单商品:
        </li>
        <li class="list-group-item">
            <span style="color: #c9302c;">${order.amount}</span>
            订单金额:
        </li>
    </ul>

    <a class="btn btn-success" style="width: 100%;" href="javascript:void(0);" onclick="getSubmit();">话费购支付</a>
    <form id="doaiAppPayFrom"  action="#" method="post"></form>
</div>
<script type="text/javascript" src="/statics/jquery/jquery.js"></script>
<script type="text/javascript" src="/statics/view/js/common.js"></script>
<script type="text/javascript">

    function getSubmit(){
        $.ajax({
            url: "/payment/submit?orderId=${order.id}&paymentPluginId=wo3DirectPlugin",
            dataType:'json',
            type:"POST",
            success: function (data){
                $("#doaiAppPayFrom").attr("action",data.requestUrl);
                $("#doaiAppPayFrom").attr("method",data.requestMethod);
                for (var key in data.parameterMap) {
                    var str="<input type='hidden' name='"+key+"' value='"+data.parameterMap[key]+"'/>";
                    $(str).appendTo("#doaiAppPayFrom")
                }
                $("#doaiAppPayFrom").submit();
            }
        });
    }
</script>
</body>
</html>